<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <title>订单支付-${setting.name}</title>
[#include "common/include.ftl"]
    <link rel="styleSheet" href="${base}/resource/css/cart.css">
</head>
<body class="customer">
<div class="top w1">
[#include "common/header-top.ftl"]
    <div class="top-search w">
        <div id="header-logo"><img src="[@Pic pic=setting.logo/]" height="60" width="200"></div>
        <div id="cart-step">
            <div class="step step3"></div>
        </div>
        <div class="clear"></div>
    </div>
</div>

<div id="order-pay">
    <div class="tips"><strong>[重要提示]：</strong><span> 销售商不会以订单异常、系统升级等为由，通过电话、短信等方式要求您点击任何链接进行退款操作。</span><i></i></div>
    <div class="order-main mt10">
        <div class="order-tips"><i class="success"></i>
            <p><span>订单已提交，请于24小时内完成支付</span><strong>( 逾期订单将被取消 )</strong></p>
        </div>
        <div class="order-address mt10">
            <div class="oad"><span>送货至：${payInfo.address} [#if payInfo.contact??]${payInfo.contact?substring(0,3)+"****"+payInfo.contact?substring(payInfo.contact?length-4, payInfo.contact?length)}[/#if]</span></div>
        </div>
        <div class="m-box mt10">
            <div class="mt"><span>应付金额：&nbsp;&nbsp;</span><span class="price"><i>¥</i><strong>${currency(payInfo.total,false)}</strong></span><span>&nbsp;&nbsp;&nbsp;(扫描支付)</span></div>
            [#if payInfo.params?? && payInfo.params.err_msg??]
                ${(payInfo.payInfo.params.err_msg)!'二维码生成失败'}
            [#else]
                <script type="text/javascript">
                    var timer;
                    $(function(){
                        var handler = function(){
                            var out_trade_no = $('input[name=out_trade_no]').val();
                            ajax({
                               url:base+"/order/resultSync.jhtml",
                                data:{"orderNo":out_trade_no},
                                type:"POST",
                                dataType:"json",
                                success:function(data){
                                    if(data.type == "success"){
                                        document.location.href="/order/result.jhtml?orderNo="+out_trade_no;
                                        clearInterval(timer);
                                    }
                                }
                            });
                        }
                        timer = setInterval(handler , 5000);
                    });
                </script>
                <input type="hidden" name="out_trade_no" value="${(payInfo.orderNo)!''}"/>
                <div class="scan"><img src="${(payInfo.params.code_img_url)!'#'}"/></div>
            [/#if]
            <div class="order-info">
                <span>订单号：${payInfo.orderNo}</span>
                <a target="_blank" href="${base}/order/detail.jhtml?orderNo=${payInfo.orderNo}">查看订单</a>
            </div>
        </div>
    </div>
</div>

[#include  "common/footer-simple.ftl"]
</body>
</html>